import java.util.*;
public class Main{
    public static void main(String[]args){
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int half=n/2;
        for(int i=half;i>0;i--){
            if(isPrime(i)&&isPrime(n-i)){
                System.out.println(i);
                System.out.println(n-i);
                break;
            }
        }
    }
    public static boolean isPrime(int num){
        for(int i=2;i*i<=num;i++){
            if(num%i==0){
                return false;
            }
        }
        return true;
    }
}
